/*** Eclipse Class Decompiler plugin, copyright (c) 2016 Chen Chao (cnfree2000@hotmail.com) ***/
package com.guoxue.dao.impl;

import com.guoxue.dao.IRechargeDao;
import com.guoxue.domain.RechargeVo;
import org.springframework.stereotype.Repository;

@Repository
public class RechargeDaoImpl extends BaseDaoImpl<RechargeVo> implements IRechargeDao {
	
	public void saveRecharge(RechargeVo rechargeVo) {
		saveOrUpdate(rechargeVo);
	}

	@Override
	public RechargeVo getRecharge(String outTradeNo) {
		return get("From RechargeVo r WHERE r.outTradeNo = ?", new Object[] {outTradeNo});
	}

	@Override
	public RechargeVo getRechargeCardNo(String cardNo,String payStatus) {
		return get("From RechargeVo r WHERE r.cardNo = ? AND r.payStatus = ? ORDER BY r.createTime DESC", new Object[] {cardNo,payStatus});
	}

	@Override
	public RechargeVo getRechargeCardNo(String cardNo, int i) {
		return get("From RechargeVo r WHERE r.cardNo = ? AND r.payStatus = ? ORDER BY r.createTime DESC", new Object[] {cardNo,i});
	}
}